package com.kotlin.hxh.ui.fragment.third

import android.os.Bundle
import android.view.LayoutInflater
import android.view.ViewGroup
import com.kotlin.hxh.R
import com.kotlin.hxh.base.BaseMainFragment
import com.kotlin.hxh.ui.fragment.third.child.ShopFragment

/**
 * @author huxh
 * @date 2018/12/20.
 */
class ZhihuThirdFragment : BaseMainFragment() {
    companion object {
        @JvmStatic
        fun newInstance(): ZhihuThirdFragment {
            val fragment = ZhihuThirdFragment()
            fragment.arguments = Bundle()
            return fragment
        }
    }

    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?) = inflater.inflate(R.layout.zhihu_fragment_third, container, false)

    override fun onLazyInitView(savedInstanceState: Bundle?) {
        super.onLazyInitView(savedInstanceState)
        if (findChildFragment(ShopFragment::class.java) == null) {
            // ShopFragment是flow包里的
            loadRootFragment(R.id.fl_third_container, ShopFragment.newInstance())
        }
    }
}